import VueRouter from "vue-router"; // 引入VueRouter

const router = new VueRouter({
  routes: [
    // 首页模板
    {
      path: "/",
      component: () => import("@/components/Layout"),
      redirect:'/home',
      children: [
        {
          path: "home",
          component: () => import("@/pages/Home"),
        },
        // 首页详情页
        {
          path: "homeDetail",
          component: () => import("@/pages/Home/Detail/Detail"),
        },
        // 个人中心页
        {
          path: "mycenter/:fromUrl?",
          name: "mycenter",
          component: () => import("@/pages/MyCenter"),
        },
        // 设置页

        // 管理员列表页
        {
          path: "adminlist",
          component: () =>
            import("@/pages/Systemsettings/Adminmanagement/Adminlist"),
        },
        // 添加管理员
        {
          path: "addnewadmin",
          component: () =>
            import("@/pages/Systemsettings/Adminmanagement/Addnewadmin"),
        },
        // 角色管理
        {
          path: "rolement",
          component: () =>
            import("@/pages/Systemsettings/Rolemanagements/Rolement"),
        },

        // 添加角色
        {
          path: '/addrole/:type',
          name: 'addrole',
          component: () => import('@/pages/Systemsettings/Rolemanagements/Addrole')
        },
        //  职称管理
        {
          path: "titlemanag",
          component: () =>
            import("@/pages/Systemsettings/Titlemanagements/Titlemanag"),
        },
        //  新增职称
        {
          path: "addtitle/:type?",
          name: "addtitle",
          component: () =>
            import("@/pages/Systemsettings/Titlemanagements/Addtitle"),
        },
        //  信息公告
        {
          path: "informent",
          component: () =>
            import("@/pages/Systemsettings/Informationments/Informent"),
        },
        // 新增信息公告
        {
          path: "addinformation/:type?",
          name: 'addinformation',
          component: () =>
            import("@/pages/Systemsettings/Informationments/Addinformation"),
        },
        // 修改密码
        {
          path: "changepassword",
          component: () =>
            import("@/pages/Systemsettings/Changepassword/Changepassword"),
        },
        // 医生管理
        {
          path: "doctorAdm",
          component: () => import("@/pages/Hospital/DoctorAdm"),
        },
        // 科室管理
        {
          path: "moduleAdm",
          component: () => import("@/pages/Hospital/ModuleAdm"),
        },
        // 体验套餐
        {
          path: "experience",
          component: () => import("@/pages/Hospital/ExperiencePackage"),
        },
        // 健康百科
        {
          path: "healthyEnc",
          component: () => import("@/pages/Hospital/HealthyEnc"),
        },
        // 医院导航
        {
          path: "HospitalNav",
          component: () => import("@/pages/Hospital/HospitalNav"),
        },
        // 门诊消费
        {
          path: "outpatientConsumption",
          component: () =>
            import("@/pages/CostManagement/OutpatientConsumptionRecord/index"),
        },
        // 门诊充值
        {
          path: "outpatientPrepaid",
          component: () =>
            import("@/pages/CostManagement/OutpatientPrepaidRecords/index"),
        },
        // 住院充值
        {
          path: "hospitalizationRecharge",
          component: () =>
            import(
              "@/pages/CostManagement/HospitalizationRechargeRecord/index"
            ),
        },
        // 住院消费
        {
          path: "hospitalizationExpense",
          component: () =>
            import("@/pages/CostManagement/HospitalizationExpenseRecord/index"),
        },
        // 退款记录
        {
          path: "refund",
          component: () =>
            import("@/pages/CostManagement/RefundRecord/index"),
        },
        // 详情页
        {
          path: "Costdetail",
          component: () =>
            import("@/pages/CostManagement/Detail/detail")
        },


        //预约挂号
        {
          path: "appegister",
          component: () => import("@/pages/Booking/Register/register"),
        },
        //预约体验
        {
          path: "Physical",
          component: () =>
            import("@/pages/Booking/Physical/physical"),
        },
        //预约核酸检测
        {
          path: "AcidTest",
          component: () => import("@/pages/Booking/AcidTest/acidTest")
        },
        //医生排班
        {
          path: "Scheduling",
          component: () =>
            import("@/pages/Booking/Scheduling/scheduling"),
        },

        
        //挂号详情
        {
          path: "Booking",
          component: () => import("@/pages/Booking/Booking"),
        },
        //病人详细信息填写表单
        {
          path: "Form",
          component: () => import("@/pages/Booking/Form.vue"),
        },
      ],
    },
    // 登录页
    {
      path: "/login/:fromUrl?",
      name: "login",
      component: () => import("@/pages/Login"),
    },
    // 注册
    {
      path: "/register/:fromUrl?",
      name: "register",
      component: () => import("@/pages/Register"),
    },
  ],
});

// 暴露路由
export default router;
